import { fetchData ,uploadFile} from "../utils/request";

export default {
  //公共
  publick:{ 
    visit(params, callback, failure) { // 页面访问量
      fetchData('/sitecount/v1/visit', params, 'post', callback, failure)
    },
    cityList(params, callback, failure) { // 城市列表
      fetchData('/aireport/v1/device/getCity', params, 'post', callback, failure)
    },
    getOpenId(params, callback, failure){
      fetchData('/aireport/v1/store/user/bindMpOpenId', params, 'post', callback, failure)
    },
    uploadFilePost(params, callback){//上传文件
      uploadFile('/aireport/v1/file/upload', params, callback)
    },
    getPosterList(params, callback, failure){
      fetchData('/aireport/v1/ad/list', params, 'post', callback, failure)
    },
    getHlepHtml(params, callback, failure){
      fetchData('/aireport/v1/help/getHelp', params, 'post', callback, failure)
    },
  },
  // 用户相关
  user:{
    login(params,callback,failure) {
      fetchData('/aireport/v1/store/user/login',params,'post',callback,failure)
    },
    loginout(params,callback,failure) {
      fetchData('/aireport/v1/store/user/logout',params,'post',callback,failure)
    },
    updatePass(params,callback,failure) {
      fetchData('/aireport/v1/store/user/updatePass',params,'post',callback,failure)
    },
    
  }, 
  entirety:{
    getData(params,callback,failure) {
      fetchData('/aireport/v1/stat/digital',params,'post',callback,failure)
    },
    equipList(params,callback,failure) {
      fetchData('/aireport/v1/device/list',params,'post',callback,failure)
    },
  },
  //报表页面接口
  data:{
    chart(params,callback,failure) {
      fetchData('/aireport/v1/stat/chart',params,'post',callback,failure)
    },
    stockDay(params,callback,failure) {
      fetchData('/aireport/v1/stockDay/statistics',params,'post',callback,failure)
    },
    statisticsDetail(params,callback,failure) {
      fetchData('/aireport/v1/stockDay/statisticsDetail',params,'post',callback,failure)
    },
    storeSaleOrder(params,callback,failure) {
      fetchData('/aireport/v1/stat/storePruchaseAndSaleOrder',params,'post',callback,failure)
    },
    
    
  },
  moreList:{
    orderList(params,callback,failure) {
      fetchData('/aireport/v1/order/list',params,'post',callback,failure)
    }
  },
  adminMng:{
    adminList(params,callback,failure) {
      fetchData('/aireport/v1/store/user/storeAdminList',params,'post',callback,failure)
    },
    addAdmin(params,callback,failure) {
      fetchData('/aireport/v1/store/user/createStoreAdmin',params,'post',callback,failure)
    },
    adminDetail(params,callback,failure){
      fetchData('/aireport/v1/store/user/storeAdminDetail',params,'post',callback,failure)
    },
    setStoreAdminStatus(params,callback,failure){
      fetchData('/aireport/v1/store/user/setStoreAdminStatus',params,'post',callback,failure)
    },
    resetStoreAdminPwd(params,callback,failure){
      fetchData('/aireport/v1/store/user/resetStoreAdminPwd',params,'post',callback,failure)
    },
    updateStoreAdmin(params,callback,failure){
      fetchData('/aireport/v1/store/user/updateStoreAdmin',params,'post',callback,failure)
    },
  },
  shopMng:{ //店铺
    shopList(params,callback,failure) {
      fetchData('/aireport/v1/store/list',params,'post',callback,failure)
    },
    shopAdd(params,callback,failure) {
      fetchData('/aireport/v1/store/add',params,'post',callback,failure)
    },
    shopDetail(params,callback,failure) {
      fetchData('/aireport/v1/store/detail',params,'post',callback,failure)
    },
    setStatus(params,callback,failure) {
      fetchData('/aireport/v1/store/setStatus',params,'post',callback,failure)
    },
    updateShop(params,callback,failure) {
      fetchData('/aireport/v1/store/update',params,'post',callback,failure)
    },
    
  },
  warehouseMng:{ //仓库
    warehouseAdd(params,callback,failure) {
      fetchData('/aireport/v1/replWarehouse/add',params,'post',callback,failure)
    },
    warehouseList(params,callback,failure) {
      fetchData('/aireport/v1/replWarehouse/list',params,'post',callback,failure)
    },
    warehouseUpdate(params,callback,failure) {
      fetchData('/aireport/v1/replWarehouse/update',params,'post',callback,failure)
    },
    warehouseSubmit(params,callback,failure) { //下补货单
      fetchData('/aireport/v1/replOrder/submit',params,'post',callback,failure)
    },
    
  },
  orderMng:{
    orderList(params,callback,failure) {
      fetchData('/aireport/v1/purchaseOrder/orderList',params,'post',callback,failure)
    },
    orderDetail(params,callback,failure) {
      fetchData('/aireport/v1/purchaseOrder/orderDetail',params,'post',callback,failure)
    },
    paySuccess(params,callback,failure) {// 我已付款
      fetchData('/aireport/v1/purchaseOrder/paySuccess',params,'post',callback,failure)
    },
    cancelOrder(params,callback,failure) {// 取消订单
      fetchData('/aireport/v1/purchaseOrder/cancelOrder',params,'post',callback,failure)
    },
    orderConfirm(params,callback,failure) {// 确认收货
      fetchData('/aireport/v1/purchaseOrder/orderConfirm',params,'post',callback,failure)
    },
  },
  stockMng:{
    stockList(params,callback,failure) {
      fetchData('/aireport/v1/stock/list',params,'post',callback,failure)
    },
    //商品 及 分类
    getCategory(params, callback, failure){
      fetchData('/aireport/v1/category/list', params, 'post', callback, failure)
    },
    //获取第三方仓库
    getSelectWarehouse(params, callback, failure){
      fetchData('/aireport/v1/goods/selectWarehouse', params, 'post', callback, failure)
    },
    getGoodsStock(params, callback, failure){
      fetchData('/aireport/v1/goods/stock', params, 'post', callback, failure)
    },
    purchaseOrderSubmit(params, callback, failure){
      fetchData('/aireport/v1/purchaseOrder/submit', params, 'post', callback, failure)
    }, 
    //库存预警
    stockThreshold(params, callback, failure){
      fetchData('/aireport/v1/stock/threshold', params, 'post', callback, failure)
    }, 
    //库存变更
    lossApply(params,callback,failure) {
      fetchData('/aireport/v1/stock/lossApply',params,'post',callback,failure)
    },
  },
  // 补货管理
  warehouseOrderMng:{
    warehouseOrderList(params, callback, failure){
      fetchData('/aireport/v1/replOrder/list', params, 'post', callback, failure)
    },
    replOrderDetail(params, callback, failure){
      fetchData('/aireport/v1/replOrder/detail', params, 'post', callback, failure)
    },
    replOrderConfirm(params, callback, failure){
      fetchData('/aireport/v1/replOrder/confirm', params, 'post', callback, failure)
    }, 
  },
  // 发票管理
  invoiceMng:{
    myInvoiceList(params, callback, failure){
      fetchData('/aireport/v1/channelInvoice/list', params, 'post', callback, failure)
    }, 
    invoiceApply(params, callback, failure){
      fetchData('/aireport/v1/channelInvoice/apply', params, 'post', callback, failure)
    }, 
    invoiceDetail(params, callback, failure){
      fetchData('/aireport/v1/channelInvoice/detail', params, 'post', callback, failure)
    }, 
    invoiceUpdate(params, callback, failure){
      fetchData('/aireport/v1/channelInvoice/updateApply', params, 'post', callback, failure)
    }, 
  },
  messageMng:{
    messageList(params, callback, failure){
      fetchData('/aireport/v1/message/getUnReadList', params, 'post', callback, failure)
    }, 
    getUnReadCount(params, callback, failure){
      fetchData('/aireport/v1/message/getUnReadCount', params, 'post', callback, failure)
    },
    setRead(params, callback, failure){
      fetchData('/aireport/v1/message/setRead', params, 'post', callback, failure)
    },
    getReadList(params, callback, failure){
      fetchData('/aireport/v1/message/getReadList', params, 'post', callback, failure)
    }
    
  }
}


